package cn.edu.java.stream.B中间操作;

import java.util.Arrays;
import java.util.stream.Stream;

public class Demo {
    public static void main(String[] args) {
        Stream<Integer> stream = Stream.of(1, 2, 3, 4, 5, 6, 6, 6, 6);

        stream
                .filter(n -> n % 2 == 0)
                .distinct()
                .map(x -> String.format("%d %d", x,x))
                .flatMap(x -> Arrays.stream(x.split(" ")))
                .sorted()
                .forEach(System.out::println);

    }
}
